home *** CD-ROM | disk | FTP | other *** search
/ CICA 1993 April / CICA MS Windows - April 1993.iso / unzipped / programr / listings / ptv2n5 / gutil13a.ptl < prev    next >
Text File  |  1991-09-27  |  39KB  |  1,142 lines

  1.  
  2.  
  3.       
  4. % ************************************************************************
  5. % ************************************************************************
  6.  
  7. % GUTIL13A Guru PostScript power tools (Alpha release)
  8.  
  9. % ************************************************************************
  10. %
  11. % SUMMARY: An interim upgrade and replacement for #102 GUTILITY.PTL that
  12. %          eliminates the ".ep1" bug and the stack clearings that caused
  13. %          dipdraw, superstroke and superinsidestroke hassles. The
  14. %          graphing grays have been upgraded, and documentation improved.
  15. %
  16. %          Additional tools newly added include roundbox, mergestrings,
  17. %          stringup borders, hrule, vrule, roman numerals, GEnie dates.
  18. %
  19. %          Excerpted from Don Lancaster's POSTSCRIPT BEGINNER STUFF.
  20. %
  21. %          Copyright c 1991 by Don Lancaster. All rights fully reserved.
  22. %          Free help line and additional info: (602) 428-4073.
  23. %
  24. % ************************************************************************
  25.       
  26. % Name of textfile: GUTIL13A.GPS
  27. % Source:           SYNERGETICS
  28. % Author:           Don Lancaster
  29. % Desc:             Intermim upgrade for #102 GUTILITY.PTL
  30. % Date:             April 12, 1991
  31. % Release:          1.0
  32. % Approx length:    40K
  33. % Status:           Copyright 1991 by Don Lancaster and Synergetics.
  34. %                   3860 West First Street, Thatcher, AZ. (602) 428-4073.
  35. %                   All commercial rights reserved. Personal use permitted
  36. %                   so long as this status message stays present and intact.
  37. %                   POSTSCRIPT SECRETS book+disk package $39.50 VISA/MC.
  38. %
  39. % Keywords:         PostScript, utility, guru, gonzo
  40. %
  41. %
  42.  
  43. %     X E     Activate XON/XOFF if necessary.
  44. %     Z       Values are shown for Apple Super Serial Card
  45.  
  46. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  47.  
  48. % This is still being revised. PLEASE TEST AND COMMENT!!!
  49.  
  50. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
  51.  
  52.  
  53.  
  54.  
  55. % name of textfile: powertool.util
  56. % ....
  57.  
  58. % decide if you want to be persistent
  59.  
  60. /persist true def
  61.  
  62. persist {serverdict begin 0 exitserver} if
  63.  
  64. /.ep0 {} def
  65. /.ep1 {} def
  66.  
  67. % last revision: April 91
  68.  
  69. /ps.util.1 {gutil} def   % substitute old name
  70. /gutility {gutil} def    % substitute old name
  71.  
  72.  
  73. 200 dict /gutil exch def gutil begin
  74.  
  75. % A series of everyday working PostScript utilities that include:
  76.  
  77. %   (1) stepnrepeat   - step and repeat routines
  78. %   (4) curvetrace    - a powerful curve tracing routine
  79. %   (5) rubbergrid    - dropout-free flexible layout grids
  80. %   (6) electronics   - electronic schematic icons for rubbergrid
  81. %   (7) arcjustify    - improved circletext routine with kerning 
  82. %   (8) nuisances     - single command replacements for complex stuff
  83. %   (11) errortrap    - improved error trapping routines
  84.  
  85. %   (1) step and repeat
  86. % . . . . . . .
  87.  
  88. /stepnrptparams 40 dict def
  89. stepnrptparams begin
  90.  
  91. /admitonetick
  92.   [6 5  9 150 60 25 25 true 10 true true] def
  93.  
  94. /babybumper
  95.   [1 2 10 270 72 40 30 false 20 true false] def
  96.  
  97. /badgeaminit
  98.   [1 2 3 220 220 90 60 false 250 true false] def
  99.  
  100. /bigbumpstick
  101.   [1 1 3 792 205 0 0 true 40 true false] def
  102.  
  103. /businesscard 
  104.   [1 3 4 256 143 12 20 true 20 true false] def
  105.  
  106. /decaapus
  107.   [1 2 5 306 158 0 0 false 50 true false] def
  108.  
  109. /hexsplit
  110.   [1 2 3 306 264 0 0 false 50 true false] def
  111.  
  112. /lilbumpstick
  113.   [1 1 5 610 150 0 20 false 60 true false] def
  114.  
  115. /octopus
  116.   [1 2 4 306 198 0 0 false 50 true false] def
  117.  
  118. /quadsplit
  119.   [1 2 2 396 306 0 0 true 50 true false] def
  120.  
  121. /readerservice
  122.   [1 12 25 25 -15 120 450 false 0 false true] def
  123.  
  124. /seqbuscard 
  125.   [1 3 4 256 143 12  20 true 20 true true] def
  126.  
  127. /shiplabel
  128.   [1 1 4 290 180 314 75 false 0 false false] def
  129.  
  130. /stdplabel
  131.   [1 1 11 254 74 320 5 false 20 true  false] def
  132.  
  133. /tenlabel
  134.  [1 2 5 305 144 0 45 false 0 false false] def
  135.  
  136. /vhsvideospline
  137.   [1 1 13 424 56 80 35 false 0 false false] def
  138.  
  139. /3.5disklabel
  140.   [1 2 3 216 226 100 60 false 20 false false] def
  141.  
  142. /5.25disklabel
  143.   [1 1 7 316 110 275 35 false 0 false false] def
  144.  
  145. end
  146.  
  147. /setrepeatparams {cvn stepnrptparams
  148. exch get aload pop /seqnumber exch
  149. def /ticktrue exch def /ticklen exch
  150. def /portrait exch def /vertstart
  151. exch def /horstart exch def /incvert
  152. exch def /inchoriz exch def /numvert
  153. exch def /numhoriz exch def
  154. /numpages exch def portrait {-90
  155. rotate -792 0 translate } if} def
  156.  
  157. /onetick { 0 ticklen 2 div rmoveto 0
  158. ticklen neg rlineto ticklen 2 div neg
  159. dup neg rmoveto ticklen 0 rlineto 0
  160. setlinewidth stroke} def
  161.  
  162. /drawticks {gsave ticktrue {0 0
  163. moveto onetick inchoriz 0 moveto
  164. onetick 0 incvert moveto onetick
  165. inchoriz incvert moveto onetick}
  166. if grestore}def
  167.  
  168. /stepandrepeat { setrepeatparams
  169. numpages {gsave horstart vertstart
  170. translate gsave numhoriz {gsave
  171. numvert { drawticks save /rptsave1
  172. exch def repeatproc  rptsave1
  173. restore  seqnumber {/runningnumber
  174. runningnumber 1 add def} if 0
  175. incvert translate } repeat
  176. grestore inchoriz 0 translate}
  177. repeat grestore showpage grestore}
  178. repeat } def
  179.  
  180. % . . . . .
  181.  
  182. % DEMO -- remove before use:
  183.  
  184. % /Helvetica-BoldOblique findfont
  185. % [11 0 0 11 0 0] makefont setfont
  186.  
  187. % /startingnumber 673 def
  188. % /runningnumber startingnumber def
  189. % /numstring 10 string def
  190.  
  191. % /repeatproc {57 70 moveto 
  192. % (This is business card #) show
  193. % runningnumber numstring cvs show
  194. % } def
  195.  
  196. % (businesscard) stepandrepeat
  197.  
  198.  
  199. % ////////////////////////
  200.  
  201. %  (2) boxdraw
  202. % . . . . .
  203.  
  204. % This section is obsolete and will be phased out. use roundbox for
  205. % all new work
  206.  
  207. %  Draws various fancy boxes and sidebars, with or without
  208. %  rounded corners and double hairlines
  209.  
  210. /boxpath {/strt br bl add 2 div def 
  211.  
  212.     /br {bl bw add} def         % attempted repair
  213.     /bc {bl bw 2 div add} def
  214.     /bb {bt bh sub } def
  215.  
  216.  
  217. newpath strt bt moveto br
  218. bt br bb brad arcto br bb bl bb brad arcto bl bb bl bt brad arcto
  219. bl bt strt bt brad arcto closepath blw setlinewidth} def
  220.  
  221. /br {bl bw add} def
  222. /bc {bl bw 2 div add} def
  223. /bb {bt bh sub} def
  224.  
  225.  
  226. /boxdraw {boxpath stroke} def /boxfill {boxpath gsave fill grestore} def
  227.  
  228. /hairdraw {gsave /hd exch def 0.5 setlinewidth bl bt hd sub moveto
  229. bw 0 rlineto 0 2.5 rmoveto bw neg 0 rlineto stroke} def
  230.  
  231. /grabbox {/blw exch def /brad exch def /bh exch def /bt exch def /bw
  232. exch def /bl exch def} def
  233.  
  234. /quickboxdraw {grabbox boxdraw} def
  235. /quickboxpath {grabbox boxpath} def
  236. /quickboxfill {grabbox boxfill} def
  237.  
  238. % defaults
  239.  
  240. /bl 200 def /bw 175 def /bt 500 def /bh 240 def /brad 7 def
  241. /blw 2 def /hd 25 def
  242.  
  243. % use examples:  boxdraw hd hairdraw -- draws the box and a title 
  244. %                boxpath -- generates only the path without stroking 
  245. %                gsave bl 10 add bb 15 add translate -- locks stuff
  246. %                   to inside of box; grestore exits
  247. %                200 175 500 240 7 2 quickboxdraw -- draws without
  248. %                   predefinition, but can't track inside height.        
  249.  
  250.  
  251. % //////////////////////////////////
  252.  
  253. % (4) curvetrace
  254. % . . . . .
  255.  
  256. % curvetrace - creates a smooth curved path from a data point list.
  257. %              enter with currentpoint set and absolute array.
  258.  
  259. /curvetrace {/curvelist exch def tension 0 eq {/tension .000001 def} if
  260.              curvelist length 3 div 1 sub cvi /#triads exch def
  261.              /ptr 0 def firstpoint morepoint} def
  262.  
  263. /tension 2.83 def   % default value for best fit
  264. /showtick false def % don't show points
  265. /ticklen 15 def     % length of ticks
  266. /tickhead ticklen 4 div def
  267.  
  268. /prvx { curvelist ptr 3 sub get } def
  269. /curx { curvelist ptr get } def
  270. /prvy { curvelist ptr 2 sub get } def
  271. /cury { curvelist ptr 1 add get } def
  272. /prva { curvelist ptr 1 sub get } def
  273. /cura { curvelist ptr 2 add get 180 sub} def
  274.  
  275. /showtic1 { showtick true eq {gsave currentpoint newpath translate cura
  276. 180 add rotate ticklen neg 2 div 0 moveto ticklen 0 rlineto tickhead neg
  277. dup rlineto  tickhead dup rlineto tickhead dup neg exch rlineto 0
  278. setlinewidth stroke 0 ticklen neg 2 div moveto 0 ticklen rlineto stroke 
  279. grestore} if }def
  280.  
  281. /firstpoint { curx cury 2 copy abs exch abs add 0 eq {pop pop currentpoint
  282. curvelist exch 1 exch put curvelist exch 0 exch put}{moveto} ifelse
  283. showtic1 /ptr ptr 3 add def}def
  284.  
  285. /morepoint {#triads { curx prvx sub dup mul cury prvy sub dup mul add sqrt
  286. tension div /zdist exch def prva cos zdist mul prvx add prva sin zdist mul
  287. prvy add cura cos zdist mul curx add cura sin zdist mul cury add curx cury
  288. curveto showtic1 /ptr ptr 3 add def} repeat} def
  289.  
  290. /showtick false def
  291.  
  292. % //////////////////////////////////
  293.  
  294. %  (5) Finegray Rubbergrid
  295. % . . . . . .
  296.  
  297. % Creates fine gray grids without dropouts or rattiness.
  298. % The code shown is device specific for 300 dpi printers.
  299.  
  300. % To create a grid, use  -hpos- -vpos- -gridsize- setgrid
  301. % Until restored, all further images will be "locked" to
  302. % the grid and will expand and contract with it. Note that
  303. % optimum linewidths and font sizes will usually be much
  304. % less than 1.0 after locking.
  305.  
  306. % To show a grid, use -#hlines- -#vlines- showgrid.
  307.  
  308. % The seegrid command displays the grid when true.
  309. % The fat5 command emphasizes every fifth line when true.
  310. % the fatter10 command emphasizes every tenth line when true.
  311.  
  312. % Here are the graphing grays. For most users most of the time,
  313. % select ggray4 or ggray5 as your default ggray.
  314.  
  315. /ggray1   {/ggray{0 setgray} def}def
  316.  
  317. /ggray2   {/ggray {150 0 {eq {1}{0} ifelse} setscreen
  318.            0.500 setgray} def} def
  319.  
  320. /ggray3   {/ggray {100 0 {eq {1}{0} ifelse} setscreen
  321.            0.667 setgray} def} def
  322.  
  323. /ggray4   {/ggray { 75 0 {eq {1}{0} ifelse} setscreen
  324.            0.750 setgray} def} def
  325.  
  326. /ggray5   {/ggray { 60 0 {eq {1}{0} ifelse} setscreen
  327.             0.800 setgray} def} def
  328.  
  329. /ggray6   {/ggray { 50 0 {eq {1}{0} ifelse} setscreen
  330.             0.833 setgray} def} def
  331.  
  332. /ggray10  {/ggray { 30 0 {eq {1}{0} ifelse} setscreen
  333.             0.900 setgray} def} def
  334.  
  335. /ggray15  {/ggray { 20 0 {eq {1}{0} ifelse} setscreen
  336.             0.933 setgray} def} def
  337.  
  338. /ggray20  {/ggray { 15 0 {eq {1}{0} ifelse} setscreen
  339.             0.950 setgray} def} def
  340.  
  341. /ggray30  {/ggray { 10 0 {eq {1}{0} ifelse} setscreen
  342.             0.966 setgray} def} def
  343.  
  344. % pick a default working ggray
  345.  
  346. /ggray {60 0 {eq {1}{0} ifelse} setscreen 0.800 setgray} def
  347.  
  348. % keep grids unlocked except for Golly Gee Mr. Science!! uses requiring not
  349. % less than two exclamation points... 
  350.  
  351. /lockggrid false def  % Don't unless really needed
  352.  
  353. % gridlockcheck checks to see if an exact pixel lock is wanted for single
  354. % dot crossings. See note above. 51.7 = QMS PS820. Your machine may also
  355. % need "exception tuning" if it does not give you perfect one dot crossings.
  356.  
  357. /gridlockcheck {lockggrid
  358.  
  359. {gsave ggray currentscreen grestore pop pop /ggraynum exch def
  360.  
  361.  
  362. ggraynum 150 eq {3 1 roll transform 2 div round 2 mul exch
  363.                 2 div round 2 mul version (51.7) eq {0.5 add } if 
  364.                 exch itransform 3 -1 roll 0 exch dtransform 2 div cvi
  365.                 2 mul idtransform exch pop} if
  366.  
  367. ggraynum 100 eq {3 1 roll transform 3 div round 3 mul exch
  368.                 3 div round 3 mul version (51.7) eq {0.5 add } if 
  369.                 exch itransform 3 -1 roll 0 exch dtransform 3 div cvi
  370.                 3 mul idtransform exch pop} if
  371.  
  372. ggraynum 75 eq {3 1 roll transform 4 div round 4 mul exch
  373.                 4 div round 4 mul version (51.7) eq {0.5 add } if 
  374.                 exch itransform 3 -1 roll 0 exch dtransform 4 div cvi
  375.                 4 mul idtransform exch pop} if
  376.  
  377. ggraynum 60 eq {3 1 roll transform 5 div round 5 mul exch
  378.                 5 div round 5 mul version (51.7) eq {0.5 add } if 
  379.                 exch itransform 3 -1 roll 0 exch dtransform 5 div cvi
  380.                 5 mul idtransform exch pop} if
  381.  
  382. ggraynum 50 eq {3 1 roll transform 6 div round 6 mul exch
  383.                 6 div round 6 mul version (51.7) eq {0.5 add } if 
  384.                 exch itransform 3 -1 roll 0 exch dtransform 6 div cvi
  385.                 6 mul idtransform exch pop} if
  386.  
  387. ggraynum 30 eq {3 1 roll transform 10 div round 10 mul exch
  388.                 10 div round 10 mul version (51.7) eq {0.5 add } if 
  389.                 exch itransform 3 -1 roll 0 exch dtransform 10 div cvi
  390.                 10 mul idtransform exch pop} if
  391.  
  392. ggraynum 20 eq {3 1 roll transform 15 div round 15 mul exch
  393.                 15 div round 15 mul version (51.7) eq {0.5 add } if 
  394.                 exch itransform 3 -1 roll 0 exch dtransform 15 div cvi
  395.                 15 mul idtransform exch pop} if
  396.  
  397. ggraynum 15 eq {3 1 roll transform 20 div round 20 mul exch
  398.                 20 div round 20 mul version (51.7) eq {0.5 add } if 
  399.                 exch itransform 3 -1 roll 0 exch dtransform 20 div cvi
  400.                 20 mul idtransform exch pop} if
  401.  
  402. }if} def
  403.  
  404.  
  405. /setgrid { gsave gridlockcheck /blocksize exch def translate
  406.            blocksize dup scale setfontssmaller} def
  407.  
  408.  
  409.  
  410. /thingridlines {0} def  % can alter if you must magnify; but best 0
  411.  
  412. /showgrid {gsave ggray /vblocks exch def /hblocks exch def
  413.  
  414. thingridlines setlinewidth
  415.  
  416.  
  417. [{0 0 moveto 0 vblocks rlineto stroke} 1
  418. hblocks 1 add] xrpt
  419.  
  420. [{0 0 moveto hblocks 0 rlineto stroke} 1
  421. vblocks 1 add] yrpt
  422.  
  423. fatterborder { gsave newpath 0 0.96 blocksize div 
  424. dtransform round idtransform 
  425. setlinewidth pop 2 setlinecap
  426. 0 0 moveto hblocks 0 rlineto 0 vblocks rlineto 
  427. hblocks neg 0 rlineto closepath stroke grestore} if
  428.  
  429. fat5 { gsave newpath 0 0.48 blocksize div dtransform round
  430. idtransform setlinewidth pop mark {5 0 moveto 0 vblocks rlineto
  431. stroke} 5 hblocks 5 div cvi] xrpt mark {0 5 moveto hblocks 0 rlineto
  432. stroke} 5 vblocks 5 div cvi] yrpt grestore} if
  433.  
  434. fatter10 { gsave newpath 0 0.96 blocksize div 
  435. dtransform round idtransform setlinewidth pop 
  436. mark {10 0 moveto 0 vblocks rlineto stroke} 10
  437. hblocks 10 div cvi] xrpt mark {0 10 moveto hblocks 0 rlineto stroke} 10
  438. vblocks 10 div cvi] yrpt grestore} if
  439.  
  440. grestore} def
  441.  
  442.  
  443. % Here are our rubbergrid controls...
  444.  
  445.    /lockrubbergrid false def  % Don't unless really needed
  446.  
  447.    /fat5 true def             % 3 pixels wide every fifth line?
  448.    /fatter10 true def         % 5 pixels wide every tenth line?
  449.    /fatterborder true def     % 5 pixel gray outline border?
  450.  
  451.  
  452.  
  453.  
  454. % rubbergrid utilities - drawing aides for the rubbergrid
  455.  
  456. % line drawing stuff
  457.  
  458. /line1  {.06 dup setlinewidth 5 mul /erase exch def} def
  459. /line2  {.12 dup setlinewidth 5 mul /erase exch def} def
  460. /line3  {.18 dup setlinewidth 5 mul /erase exch def} def
  461.  
  462.  
  463. % deferred font setting  TEMPORARY - will be moved to gonzo
  464.  
  465. /setfontssmaller {
  466.  
  467. /font1 /Helvetica [0.7 0 0 0.8 0 0] gonzofont
  468. /font2 /Helvetica-Bold [0.7 0 0 0.8 0 0] gonzofont
  469. /font3 /Symbol [0.7 0 0 0.8 0 0] gonzofont
  470. /font4 /Helvetica [0.5 0 0 0.4 0 0] gonzofont
  471. /font5 /Helvetica-Bold [1.6 0 0  1 0 0] gonzofont
  472.  
  473. /yinc 1 def /pmrun 0 def /charstretch 0.033 def /spacestretch 0.05 def
  474. /ybot -9999 def  /lastlinestretch lastlinestretch 0.1 mul def
  475. } def
  476.  
  477.  
  478. /mt {moveto} def
  479. /rm {rmoveto} def
  480. /rl {rlineto} def
  481.  
  482. % these draw individual lines 
  483.  
  484. /x {rlineto currentpoint stroke moveto} def
  485. /r {0 x} def
  486. /r+ {dup x} def
  487. /r- {dup neg x} def
  488.  
  489. /l {neg 0 x} def
  490. /l+ {neg dup neg x} def
  491. /l- {neg dup x} def
  492.  
  493. /u {0 exch x} def
  494. /d {0 exch neg x} def
  495.  
  496. % these create a path
  497.  
  498. /pl {neg 0 rl} def
  499. /pl+ {neg dup neg rl} def
  500. /pl- {neg dup rl} def
  501.  
  502. /pr { 0 rl} def
  503. /pr+ {dup rl} def
  504. /pr- {dup neg rl} def
  505.  
  506. /pu {0 exch rl} def
  507. /pd {0 exch neg rl} def
  508.  
  509. % these draw a line and "erase" across the background
  510.  
  511. /ux {0 exch 2 copy gsave 1 setgray erase setlinewidth
  512. currentpoint .18 add moveto 0 setlinecap x grestore x } def
  513.  
  514. /dx {neg 0 exch 2 copy gsave 1 setgray erase setlinewidth
  515. currentpoint .18 sub moveto 0 setlinecap x grestore x } def
  516.     
  517. /rx {0 2 copy gsave 1 setgray erase setlinewidth
  518. currentpoint exch .18 add exch moveto 0 setlinecap x grestore x } def
  519.  
  520. /lx {neg 0 2 copy gsave 1 setgray erase setlinewidth
  521. currentpoint exch .18 sub exch moveto 0 setlinecap x grestore x } def
  522.  
  523. /dot { currentpoint newpath 0.150 0 360 arc fill } def
  524. /mdot { m dot} def
  525.  
  526.  
  527. % some small default circles
  528.  
  529. /circ1 {gsave currentpoint newpath 0.20 0 360 arc whitefill
  530. line1 stroke grestore} def %for circle
  531.  
  532. /circ2 {gsave currentpoint newpath 0.200 0 360 arc whitefill
  533. line2 stroke grestore} def %for complement
  534.  
  535. /circ3 {gsave currentpoint newpath  0.8 0 360 arc line2 stroke
  536.  grestore} def %for led
  537.  
  538. /circ4 {gsave currentpoint newpath  0.33 0 360 arc whitefill
  539. line2 stroke grestore} def  %for test point and switches
  540.  
  541. % repeats [ proc distance trips] xrpt
  542.  
  543. /xrpt{gsave aload pop /trips exch def /dist exch def /rproc exch def
  544. trips { gsave rproc grestore dist 0 translate } repeat grestore} def
  545.  
  546. /yrpt{gsave aload pop /trips exch def /dist exch def /rproc exch def
  547. trips { gsave rproc grestore 0 dist translate } repeat grestore} def
  548.  
  549. % some arrows . . .
  550.  
  551. /uarrow {-.15 -.8 rlineto .3 0 rlineto closepath fill} def
  552. /darrow {gsave 180 rotate 0 0.8 rmoveto uarrow grestore} def
  553. /rarrow {gsave -90 rotate uarrow grestore} def
  554. /larrow { gsave 90 rotate uarrow grestore} def
  555.  
  556. /whitefill { gsave 1 setgray fill grestore} def
  557.  
  558. % //////////////////////////////////
  559.  
  560. %  (6) electronics
  561. % . . . . . .
  562.  
  563. % This section is being revised and improved
  564.  
  565. % Opaque icons for use with the rubbergrid system.
  566. % This is older code that still needs rework.
  567. % In general, use -xpos- -ypos- iconname
  568.  
  569. /electronics 200 dict def electronics begin
  570.           
  571. /micro {font3 (m) show font1} def
  572. /ohms {font3 (W) show font1} def
  573.  
  574. /tstpt {mt circ4 currentpoint 0.15 0 360 arc fill} def
  575.  
  576. /xinv {0 1.25 rlineto 2.5 -1.25 rlineto -2.5 -1.25 rlineto
  577.       closepath whitefill line2 stroke} def
  578.  
  579.  
  580. /rinverter{ mt gsave xinv grestore 2.7 0 rm circ2} def
  581. /linverter {mt gsave 180 rotate xinv grestore -2.7 0 rm circ2 } def
  582.  
  583.  
  584. /res {-0.8 0 rmoveto gsave 1.6 0 rlineto line1 1 setgray stroke 
  585. grestore  0.10 0.3 rlineto 3 { .20 -.6 rlineto .20 .6 rlineto}
  586. repeat .20 -.6 rlineto 0.10 0.3 rlineto stroke} def
  587. /hresistor {mt res} def
  588. /vresistor { mt gsave 90 rotate res grestore} def
  589.  
  590. /lpot { gsave translate gsave 0 -0.10 translate 0 0 vresistor grestore
  591.         -.2 0 moveto rarrow grestore} def
  592.  
  593. /cap {currentpoint 2 copy gsave 1 setgray 0 -.20 rlineto stroke grestore
  594. moveto -.6 0 rmoveto 1.2 0 rlineto stroke 
  595. moveto 0 -1.2 rmoveto currentpoint newpath 1 55 125 arc stroke } def
  596. /vcap { mt cap } def
  597. /hcap { mt gsave 90 rotate cap grestore} def
  598. /uvcap { mt gsave 180 rotate cap grestore} def
  599.  
  600. /schmitt {mt 0.3 0.3 rmoveto line1 -0.4 0 rlineto 0 -0.6
  601. rlineto -.2 0 rlineto 0.4 0 rlineto 0 .6 rlineto stroke} def
  602.  
  603. /dpdt {gsave translate 0 0 mt gsave newpath 0 0 mt 1 setgray
  604. 0.3 setlinewidth 0 2 rlineto 1.5 0 rlineto 0 -2 rlineto stroke
  605. grestore circ2 0 1 rm circ2 0 1 rm circ2 1.5 0 rm circ2 0 -1 rm
  606. circ2 0 -1 rm circ2  .2 setlinewidth 1 setlinecap -.35 .05 rm 1 u
  607. -.55 0 rm 1 d grestore} def
  608.  
  609. /spdt { gsave translate 0 0 mt gsave newpath 0 0 mt 1 setgray 0.3
  610. setlinewidth 0 2 rlineto 1.5 0 rlineto 0 -2 rlineto stroke grestore
  611. circ2 0 1 rm circ2 0 1 rm circ2 0.2 setlinewidth 1 setlinecap .45
  612. 0.05 mt 1 u grestore} def
  613.  
  614. /diode{ currentpoint newpath moveto -.3 0 rmoveto gsave .7 -.4 rlineto 0 .8
  615. rlineto closepath fill grestore -0.05 -.4 rmoveto 0 .8 rlineto
  616. 0.1 setlinewidth stroke } def 
  617.  
  618. /udiode { gsave moveto -90 rotate  diode grestore } def
  619. /ddiode { gsave moveto 90 rotate diode grestore} def
  620.  
  621. /led {  mt currentpoint circ3 ddiode } def
  622.  
  623. % ......
  624.  
  625. /negpulse { moveto -.35 .5 rmoveto .2 0 rlineto 0 -.5 rlineto
  626.           0.3 0 rlineto 0 .5 rlineto .2 0 rlineto stroke} def 
  627.  
  628. /pospulse { gsave 180 rotate negpulse grestore} def
  629.  
  630. % ....
  631.  
  632. % +5 
  633.  
  634. /5vdc {gsave 0 .8 rlineto currentpoint stroke .2 add
  635.  0.2 0 360 arc gsave 0.1 setlinewidth stroke grestore } def
  636.  
  637. /xend { gsave -.1 0 rmoveto 0 .3 rlineto .2 0 rlineto 0 -.6 rlineto -.2 0
  638. rlineto closepath line1 stroke grestore} def
  639.  
  640. /hxtal { mt gsave -.33 0 rmoveto 0.66 0 rlineto 0.3 setlinewidth 1 setgray stroke  
  641.   grestore gsave currentpoint exch -.35 add exch moveto
  642. xend  0.7 0 rmoveto xend grestore
  643. gsave 0 0.5  rmoveto 0 -1 rlineto 
  644. 0.2 setlinewidth stroke grestore} def
  645.  
  646. /sensor { gsave 2 copy vresistor .1 setlinewidth .5 sub
  647.           newpath .6 0 -180 arcn
  648.           0 1.1 rlineto currentpoint stroke exch 0.6 add exch .6
  649.           180 0 arcn 0 -1.1 rlineto stroke grestore} def
  650.  
  651.  
  652. % ......
  653.  
  654. % gnd
  655.  
  656. /ground { -.4 0 rmoveto 0.8 0 rlineto -.65 -0.2 rmoveto .5 0 rlineto
  657.  -0.35 -0.2 rmoveto .2 0 rlineto
  658. stroke} def
  659.  
  660. /uground {gsave 180 rotate ground grestore} def
  661. /lground {gsave -90 rotate ground grestore} def
  662. /dground {gsave 90 rotate ground grestore} def
  663.  
  664. /edgecon { gsave line2 mt 0 1.7 rm currentpoint newpath 0.3 180 0
  665. arcn 1.7 d 0.6 l 1.7 u closepath gsave 1 setgray fill grestore stroke
  666.  grestore} def
  667.  
  668. /whitefill { gsave 1 setgray fill grestore} def
  669.  
  670. /cell { gsave translate newpath 1 setgray  0 setlinecap
  671. 0 .3 mt 2 setlinewidth 0 -.6 rlineto  stroke 0 setgray -.6
  672. 0.2 mt 0.3 setlinewidth 1.2 r stroke 
  673. -1 -.3 mt line2 2 r
  674. grestore} def 
  675.  
  676.  
  677. % //// DIPDRAW PROC /////
  678.        
  679. % dipdraw - draws a dip integrated circuit.
  680.  
  681. % Enter with currentpoint set to pin 1 and scale
  682. % set so that 1.0 = distance between pins.  Then
  683. % do a numpins-(name)-(hipins)-(lopins) dipdraw
  684. % Pin callouts preceeded by / will be complemented.
  685.     
  686. % main dipdraw entry:
  687.  
  688. /dipdraw { save /snap exch def /hipins exch def /lopins
  689. exch def /chipname exch def /numpins exch def /howlong
  690. {numpins 2 div cvi 1 add} def /howhigh {4 numpins 36 ge
  691. {1 add} if} def /stub {howhigh 1.4 sub 2 div} def
  692.  
  693. % internal service subs start here:
  694.  
  695. /pinproc {numpins 2 div cvi{newpath 0 cpos 0.37 0 360 arc
  696. gsave 1 setgray fill grestore 0.067 setlinewidth stroke 
  697. pin# 5 string cvs dup stringwidth pop 2 div neg cpos
  698. 0.2 sub moveto show 1 0 translate /pin# pin# dir add
  699. def} repeat } def
  700.  
  701. /stretchprint { dup stringwidth pop 2 div neg exch length
  702. 1 sub stretch mul 2 div sub  0 moveto callout (/)
  703. anchorsearch true eq {currentpoint exch stretch add exch
  704. moveto pop dup /callout exch def stringwidth
  705. pop callout length 1 sub stretch mul add /barwide exch def
  706. 0.033 setlinewidth gsave currentpoint 0.55 add moveto
  707. barwide 0 rlineto stroke grestore} if stretch 0 callout
  708. ashow pop} def
  709.  
  710. /pincallouts{0 vpos translate {workstring ( ) search true
  711. eq {/callout exch def pop /workstring exch def callout
  712. stretchprint 1 0 translate}{dup /callout exch def
  713. stretchprint exit } ifelse}loop} def
  714.  
  715. % actual dipdraw process starts here:
  716.  
  717. % ........ the outline:
  718.  
  719. gsave 1 setlinecap 1 setlinejoin
  720. currentpoint translate newpath -.55 .45 0.15 0 360
  721. arc fill newpath -1 howhigh 2 div 0.7 -90 90  arc 0 stub
  722. rlineto howlong 0 rlineto 0 howhigh neg rlineto howlong
  723. neg 0 rlineto closepath 0.36 setlinewidth stroke
  724.  
  725. % ........ pin circles and numbers:
  726.  
  727. /Helvetica-Bold findfont [0.4 0 0 0.55 0 0] makefont
  728. setfont gsave /pin# 1 def  /dir 1 def /cpos 0 def pinproc
  729. grestore gsave /pin# numpins def  /dir -1 def /cpos howhigh
  730. def pinproc grestore
  731.  
  732.  
  733. % ........ pin callouts:
  734.  
  735. /Helvetica findfont [0.35 0 0 0.6 0 0] makefont setfont
  736. /stretch 0.033 def gsave /workstring hipins def /vpos
  737. 0.6 def  pincallouts grestore gsave /workstring
  738. lopins def /vpos howhigh 1.05 sub def pincallouts
  739. grestore
  740.  
  741. % ....... device number:
  742.  
  743. % was 1.4 0 0 1 0 0
  744.  
  745. /Helvetica-Bold findfont [1.4 0 0 1 0 0] makefont setfont
  746. /stretch 0.05 def gsave numpins 2 div 1 sub 2 div howhigh
  747. 2 div 0.33 sub translate chipname dup /callout exch def
  748. stretchprint grestore
  749.  
  750. % ....... end cleanup:
  751.  
  752. grestore grestore
  753. snap restore} def
  754.  
  755. % ...
  756.  
  757. % new inductor stuff
  758.  
  759. /lloop { .5 1  -.5 1 0 0 rcurveto} def
  760. /ltie {.2 -.30 .4 -.30 .6 0 rcurveto} def
  761. /lexit{.2 -.40 .4 0 .6 0 rcurveto .4 r } def
  762. /lentry {.4 r .2 0  .4 -.4  .6 0 rcurveto} def
  763.  
  764. /hcoil { /numloops exch def lentry
  765. numloops 1 sub {lloop ltie} repeat lloop lexit} def
  766.  
  767. /winding {gsave /numloops exch def translate 0 0 moveto 0 rotate
  768. numloops hcoil grestore} def
  769.  
  770. /vwinding {gsave /numloops exch def translate 0 0 moveto 90 rotate
  771. numloops hcoil grestore} def
  772.  
  773. /vrwinding {gsave /numloops exch def translate 90 rotate 1 -1 scale
  774. 0 0 moveto numloops hcoil grestore} def
  775.  
  776. /phonejack {gsave translate 1 setlinecap 0 0 mt 0.15 u 3.85 r 0.3 d
  777. 3.85 l 3.95 0.15 mt 0.15 r 0.1 -0.15 rlineto  -0.1 -0.15 rlineto 0.15
  778. l 0.3 u 0.4 setlinewidth 2 setlinecap 0 0 mt 2 r 1 setlinecap 0 0.2 mt
  779. 2 r 0 -0.2 mt 2 r grestore } def
  780.  
  781. /lilphonejack{ gsave translate 0.8 dup scale 0 0 phonejack grestore} def
  782.  
  783. /varistor {gsave translate gsave -.5 0 mt 0.6 setlinewidth 1 setgray
  784. 1 r grestore line2 0.6 0.3 mt 1.2 l 0.6 -0.3 mt 1.2 l -0.45 -0.25 mt
  785. 0.3 0.50 rlineto 0.3 -0.50 rlineto 0.3 0.50 rlineto
  786. stroke grestore} def
  787.  
  788. /piezo { gsave translate 0 0 mt gsave 5 dup scale circ1 grestore 
  789. gsave 2.5 dup scale circ1 grestore grestore } def
  790.  
  791. /pctab {gsave 1 setlinecap 1 setlinejoin line2 1 u 2 r
  792. 1 d 2 l grestore} def
  793.  
  794. /npn {gsave newpath exch 0.2 sub exch translate -.1 0 1.2
  795. 0 360 arc gsave 1 setgray fill grestore line2 stroke -0.2
  796. 0 translate line3 -.3 -.7 moveto 1.4 u line1 -.3 0 mt 1.3
  797. l -.2 .4 mt 0.6 0.4 rlineto 1.2 u newpath -.2 -0.4 mt 0.6
  798. -0.4 rlineto 1.2 d newpath 0.4 -0.75 mt -.2 .3 rlineto
  799. -.2 -.3 rlineto closepath fill grestore} def
  800.  
  801. /npnl {gsave translate -1 1 scale 0 0 npn grestore} def
  802.  
  803. /pnp {gsave newpath exch 0.2 sub exch translate -.1 0 1.2
  804. 0 360 arc gsave 1 setgray fill grestore line2 stroke -0.2
  805. 0 translate line3 -.3 -.7 moveto 1.4 u line1 -.3 0 mt 1.3
  806. l -.2 .4 mt 0.6 0.4 rlineto 1.2 u newpath -.2 -0.4 mt 0.6
  807. -0.4 rlineto 1.2 d newpath -.2 .4 mt .3 .4 rlineto .1 -.3
  808. rlineto closepath fill grestore} def
  809.  
  810. /pnpl {gsave translate -1 1 scale 0 0 pnp grestore} def
  811.  
  812.  
  813.  
  814.  
  815. end % -- the electronics dictionary
  816.  
  817. % //////////////////////////
  818.  
  819. % (7) arc justify - sets circular text. 
  820. % . . . . .
  821.  
  822. % To use, -xpos -ypos- -radius- (message) arcjustify
  823. % A positive radius creates upward curving arcs.
  824. % A negative radius creates downward curving arcs.
  825. % Use -arckern- to stretch or compress message.
  826.  
  827. /arckern 2 def /str ( ) def
  828.  
  829. /arcjustify {gsave /msg exch def /radius exch def translate
  830. msg dup stringwidth pop exch length 1 sub arckern mul add 2 div 
  831. dup 57.29578 mul radius div msg {str exch 0 exch put gsave
  832. rotate 0 radius moveto str dup dup stringwidth pop 2 div 
  833. 57.29578 mul radius div neg rotate show stringwidth pop arckern
  834. add sub dup 57.29578 mul radius div grestore} forall pop pop
  835. grestore} def
  836.  
  837. % demo -- /Helvetica-Bold findfont [100 0 0 100 0 0] makefont
  838. % setfont 200 0 500 (FREE FONT) arcjustify
  839.  
  840.  
  841. % //////////////////////////////////
  842.  
  843. %  (6) nuisance solvers
  844. % . . . . . .
  845.  
  846. %  nuisance - a dictionary of commonly used PostScript sequences
  847. % . . . . . . . . . . 
  848.  
  849. %  Copyright c 1988 by Don Lancaster and Synergetics, Box 809, 
  850. %  Thatcher, AZ 85552.  (602) 428-4073. All rights reserved
  851. %  Personal, non-commercial use permitted so long as this 
  852. %  header remains present and intact. Latest disk costs $24.50.
  853.  
  854. %  nuisancedict is usually persistently downloaded as a dictionary.
  855. %  it is activated when needed by -- nuisance begin -- .
  856.  
  857.  
  858. 200 dict /nuisance exch def nuisance begin
  859.  
  860. /acos {2 copy dup mul exch dup mul sub sqrt exch pop
  861. exch atan} def % arccosine use  - xside hypotenuse acos -
  862.  
  863. /asin {2 copy dup mul exch dup mul sub sqrt exch pop
  864. atan} def % arcsine use  - yside hypotenuse asin -
  865.  
  866. /backwards { 612 0 translate  -1 1 scale} def  % print backwards
  867.  
  868. /bestgray {106 45 {dup mul exch dup mul add 1.0 exch sub} setscreen} def
  869.  
  870. /black {0 setgray} def % draw in black
  871.  
  872. /blackflash {0 0 moveto 1000 0 rlineto 0 1000 rlineto -1000 0 rlineto
  873. closepath fill showpage } def % black pre-page for highest print quality
  874.  
  875. /copies { /#copies exch def} def  % as in -- 6 copies --
  876.  
  877. /feetfirst {180 rotate -612 -792 translate} def % eject print feet first
  878.  
  879. /flushends {0 setlinecap} def        % flush path ends
  880.  
  881. /flushjoins {0 setlinejoin} def      % flush path joins
  882.  
  883. % GEniejul converts GEnie dates to Julian dates Enter with a six
  884. % digit integer; leave with date string on stack
  885.  
  886. /GEniejul { (      ) cvs dup 2 2 getinterval cvi 1 sub [(January )
  887. (February )(March )(April )(May )(June )(July )(August )(September )
  888. (October )(November )(December )] exch get 1 index 4 2 getinterval
  889. (, ) mergestr mergestr exch 0 2 getinterval cvi dup 50 gt {1900}
  890. {2000}ifelse add (      )cvs mergestr} def
  891.  
  892.  
  893. % hrule does a fixed horizontal rule, given xstart ystart xend linewidth
  894.  
  895. /hrule {gsave newpath setlinewidth 1 index 4 2 roll moveto lineto 
  896. stroke grestore} def
  897.  
  898. % vrule does a fixed vertical rule, given xstart ystart yend linewidth
  899.  
  900. /vrule {gsave newpath setlinewidth 2 index 4 2 roll moveto exch lineto 
  901. stroke grestore} def
  902.  
  903. /inch {72 mul} def % inches    
  904.  
  905. /indiagray {135 35 {dup mul exch dup mul add 1.0 exch sub} setscreen} def
  906.  
  907. /landscape {-90 rotate -792 0 translate} def  % pick landscape printing
  908.  
  909. /lightgray {0.99 setgray} def
  910.  
  911. /listfonts {FontDirectory {pop == flush 200 {37 sin pop}
  912. repeat } forall} def % send installed font list to host
  913.  
  914. /longjob {statusdict /waittimeout 180 put} def % lengthen job timeout
  915.  
  916. /manual {statusdict /manualfeed true put} def % start manual feed
  917.  
  918. % mergestr merges the two top stack strings into one top stack string
  919.  
  920. /mergestr {2 copy length exch length add string dup dup 4 3 roll
  921. 4 index length exch putinterval 3 1 roll exch 0 exch putinterval} def
  922.  
  923. /negative {{1 sub abs} settransfer} def % negative printing
  924.  
  925. /outline {false charpath} def % finds character outline path
  926.  
  927. /persist {serverdict begin 0 exitserver} def % starts persistent download
  928.  
  929. /pi 3.1415926 def % you wanted rhubarb instead?
  930.  
  931. /pixel {72 mul 300 div} def % 300 dpi only
  932.  
  933. /positive {{} settransfer} def % restore positive printing
  934.  
  935. /printfonts {/Helvetica findfont [10 0 0 10 0 0] makefont
  936. setfont /xpos 150 def /ypos 600 def /yinc 12 def xpos 20
  937. sub ypos 20 add moveto (CURRENTLY INSTALLED FONTS:) show
  938. FontDirectory {pop 100 string cvs xpos ypos moveto (/) show
  939. show /ypos ypos 12 sub def} forall showpage} def % on paper
  940.  
  941. /putridgray {53 45 {dup mul exch dup mul add 1.0 exch sub} setscreen} def
  942.  
  943. /random {rand 65536 div 32768 div mul cvi} def  % as in -- 6 random --
  944.  
  945. /report {== flush 100 {37 sin pop} repeat } def % top of stack to host
  946.  
  947. /reprogray {85 35 {dup mul exch dup mul add 1.0 exch sub} setscreen} def
  948.  
  949. % Romnum routine converts any number from 0-99 into its equivalent Roman
  950. % numerals. Enter with stack integer. Leave with stack Roman string.
  951.  
  952. /Romnum { dup 10 div cvi [() (x) (xx) (xxx) (xl) (l) (lx) (lxx) 
  953. (lxxx) (xc)] exch get (    ) cvs exch 10 mod cvi [() (i)(ii)(iii)
  954. (iv)(v)(vi)(vii)(viii)(ix)] exch get mergestr} def
  955.  
  956. /roundends {1 setlinecap} def        % rounded path ends
  957. /roundjoins {1 setlinejoin} def      % rounded path joins
  958.  
  959. % This creates a rounded path from -radius- [x1 y1  x2 y2 ... xn yn]
  960. % roundpath. Does NOT round path ends. Use roundbox for boxes
  961.  
  962. /roundpath {/rpdata exch def /rprad exch def rpdata length 1 sub
  963. cvi /rppoints exch def rpdata 0 get rpdata 1 get moveto 2 2  rppoints
  964. 2 sub {/rpvalue exch def 0 1 3 {rpdata exch rpvalue add get } for
  965. rprad arcto pop pop pop pop} for rpdata rppoints 1 sub get rpdata
  966. rppoints get lineto} def
  967.  
  968. % roundbox draws a box path with rounded corners and locks you to the
  969. %  lower lefthand box corner using this format ...
  970. %      -xpos- -ypos- -xwidth- -yheight- -cornerrad- roundbox
  971.  
  972. /roundbox {gsave /rad exch def /bt exch def /br exch def /bb exch
  973. def /bl exch def bl bb translate rad mark br 2 div 0 0 0 0 bt br
  974. bt br 0 br 2 div 0] roundpath /bc br bl sub 2 div def} def
  975.  
  976. /snoop {1183615869 internaldict begin} def  % activates superexec
  977.  
  978. /stockends {2 setlinecap} def        % default path ends
  979.  
  980. /stockjoins {2 setlinejoin} def      % default path joins
  981.  
  982. /stall {{37 sin pop} repeat} def % delay as in  -- 1500 stall --  
  983.  
  984. % timing utilities. use stopwatchon and stopwatchoff for simple
  985. % one shot timing. For multiple time totals, use resettimer
  986. % starttimer stoptimer ... starttimer stoptimer reporttimer
  987.  
  988.  
  989. /stopwatchoff {stoptimer reporttimer} def % for single shots
  990.  
  991. /stopwatchon {resettimer starttimer} def % for single shots
  992.  
  993. /reporttimer {mytime 1000 div (\rElapsed time: ) print 20
  994. string cvs print ( seconds.\r) print flush} def % to host
  995.  
  996. /resettimer {/mytime 0 def} def % reset timer
  997.  
  998. /starttimer {usertime /mytimenow exch def} def % add to time so far 
  999.  
  1000. /stoptimer {usertime mytimenow sub /mytime exch mytime
  1001. add def} def % for multiple timing intervals
  1002.  
  1003. % stringdown, et al repeats a string of one or more characters to form
  1004. % a fancy border. use  -#repeats- -spacing- (char) stringdown, etc.
  1005.  
  1006. /stringdown {/char exch def /vcharsp exch def {gsave char
  1007. show currentpoint vcharsp sub moveto} repeat} def
  1008.  
  1009. /stringleft {/char exch def /hcharsp exch def {gsave char
  1010. show currentpoint exch hcharsp sub exch moveto} repeat} def
  1011.  
  1012. /stringright {/char exch def /hcharsp exch def {gsave char
  1013. show currentpoint exch hcharsp add exch moveto} repeat} def
  1014.  
  1015. /stringup {/char exch def /vcharsp exch def {gsave char
  1016. show currentpoint vcharsp add moveto} repeat} def
  1017.  
  1018. % superstroke and superinsidestroke take a predefined path and a
  1019. % top-of-stack array of [width1 gray1  width2 gray2 .... widthn grayn]
  1020. % and do multiple strokes for wires, fancy borders, or braiding.
  1021. % Note that the FIRST array value pair has to be the WIDEST, etc.
  1022. % Use superstroke for wires; superinsidestroke for borders. 
  1023.  
  1024. /superstroke { save /sssnap exch def /sscmd exch def mark 0 2 sscmd length
  1025. 2 div cvi 1 sub 2 mul {/aposn exch def gsave sscmd aposn get
  1026. setlinewidth sscmd aposn 1 add get setgray stroke grestore} for cleartomark
  1027. sssnap restore newpath} def
  1028.  
  1029. /superinsidestroke {save clip /sssnap exch def /sscmd exch def mark 0 2
  1030. sscmd length 2 div cvi 1 sub 2 mul {/aposn exch def gsave sscmd aposn
  1031. get 2 mul setlinewidth sscmd aposn 1 add get setgray stroke grestore}
  1032. for cleartomark sssnap restore newpath} def
  1033.  
  1034. /tan {dup sin exch cos dup 0 eq {pop 0.000001} if div} def % tangent
  1035.  
  1036. /tray  {statusdict /manualfeed false put} def % stop manual feed
  1037.  
  1038. /white {1 setgray} def   % print in white
  1039.  
  1040. /width {stringwidth pop} def % finds x width of string
  1041.  
  1042.  
  1043. end  % the nuisance dictionary
  1044.  
  1045.  
  1046. % //////////////////////////
  1047.  
  1048. % (11) switchable error trapper
  1049. % . . . . .
  1050.  
  1051. % Creates a printing error trapper that dumps the stack and prints what you
  1052. % have accomplished so far. While EXTREMELY useful, this is definitely NOT
  1053. % to be a replacement for true two-way comm. Adapted from EHANDLER.PS.
  1054.  
  1055. % Use gutil begin printerror at the start of your file for time-of-error
  1056. % printout and stack dump
  1057.  
  1058. /printerror {/$brkpage 64 dict def $brkpage begin /prnt {dup 
  1059. type/stringtype ne{=string cvs}if dup length 6 mul /tx exch def/ty
  1060. 10 def currentpoint/toy exch def/tox exch def 1 setgray newpath
  1061. tox toy 2 sub moveto 0 ty rlineto tx 0 rlineto 0 ty neg rlineto
  1062. closepath fill tox toy moveto 0 setgray show}bind def /nl{currentpoint
  1063. exch pop lmargin exch moveto 0 -10 rmoveto}def /=={/cp 0 def
  1064. typeprint nl}def /typeprint{dup type dup currentdict exch known
  1065. {exec}{unknowntype}ifelse}readonly def /lmargin 72 def /rmargin 72 def
  1066. /tprint {dup length cp add rmargin gt{nl/cp 0 def}if dup length cp
  1067. add/cp exch def prnt}readonly def /cvsprint{=string cvs tprint( )tprint
  1068. }readonly def/unknowntype{exch pop cvlit(??)tprint cvsprint}readonly
  1069. def/integertype{cvsprint}readonly def/realtype{cvsprint}readonly def
  1070. /booleantype{cvsprint}readonly def/operatortype{(//)tprint cvsprint}
  1071. readonly def/marktype{pop(-mark- )tprint}readonly def/dicttype{pop
  1072. (-dictionary- )tprint}readonly def/nulltype{pop(-null- )tprint}readonly
  1073. def/filetype{pop(-filestream- )tprint}readonly def/savetype{pop
  1074. (-savelevel- )tprint}readonly def/fonttype{pop(-fontid- )tprint}readonly
  1075. def/nametype{dup xcheck not{(/)tprint}if cvsprint}readonly def/stringtype
  1076. {dup rcheck{(\()tprint tprint(\))tprint}{pop(-string- )tprint}ifelse
  1077. }readonly def/arraytype{dup rcheck{dup xcheck{({)tprint{typeprint}
  1078. forall(})tprint}{([)tprint{typeprint}forall(])tprint}ifelse}{pop
  1079. (-array- )tprint}ifelse}readonly def/packedarraytype{dup rcheck{dup
  1080. xcheck{({)tprint{typeprint}forall(})tprint}{([)tprint{typeprint}
  1081. forall(])tprint}ifelse}{pop(-packedarray- )tprint}ifelse}readonly def
  1082. /courier/Courier findfont 10 scalefont def/OLDhandleerror errordict
  1083. /handleerror get def end errordict /handleerror {systemdict begin $error
  1084. begin $brkpage begin newerror{/newerror false store $error /errorname
  1085. get (ioerror) ne $error /command get (exec) ne or {vmstatus pop pop 0
  1086. ne{grestoreall}if initgraphics courier setfont lmargin 720 moveto
  1087. (ERROR: )prnt errorname prnt nl(OFFENDING COMMAND: )prnt/command
  1088. load prnt $error/ostack known {nl nl(STACK:)prnt nl nl $error/ostack
  1089. get aload length{==}repeat}if systemdict/showpage get exec /newerror
  1090. true store/OLDhandleerror load end end end exec}{end end end} ifelse}
  1091. {end end end}ifelse} dup 0 systemdict put dup 4 $brkpage put bind
  1092. readonly put} def
  1093.  
  1094. % //////////////////////////////////
  1095.  
  1096.  
  1097. end % the entire utility dictionary
  1098.  
  1099. quit
  1100.  
  1101.  
  1102.  
  1103. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1104.  
  1105. % Related GEnie PSRT Downloads: 
  1106.  
  1107. %            >>>>> THIS FILE REPLACES #102 GUTILITY.PTL <<<<<
  1108.  
  1109. %            #257 - GNZOTRX1.GPS   Gonzo Special Effects Part I
  1110. %            #256 - GURUTEMP.GPS   Gonzo Multipage/Multifigure Template
  1111. %            #253 - EXTRACR.TXT    Solving PS Carriage Return Hassles
  1112. %            #252 - KEYSTJST.GPS   Gonzo keystone justification tools  
  1113. %            #251 - PAGESBLD.GPS   Gonzo Page Builder Template 
  1114. %            #248 - MENUJUST.GPS   Gonzo menu justification
  1115. %
  1116. %            #242 - NEWGTOOL.AII   Gonzo glossary-lbreaker-fntpicker 
  1117. %            #238 - PULPNOVL.GPS   2-up BOD pulp novel template
  1118. %            #220 - GONZO13A.TXT   Gonzo 13A Tutorial
  1119. %            #219 - GONZO13A.PTL   Gonzo 13A Powertool
  1120. %            #109 - RAWPS.TXT      Working with raw PostScript
  1121. %            #102 - GUTILITY.PTL   Guru Utility PowerTools (DO NOT USE)
  1122. %
  1123. %            #245 - PSRTXREF.TXT   PSRT Xref & planner (Text only)
  1124. %            #246 - PSRTXREF.PS    PSRT Xref & planner (Hard copy)
  1125.  
  1126. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1127.  
  1128. % Reprinted from Don Lancaster's POSTSCRIPT BEGINNER STUFF.
  1129. % Now available via GEnie email from SYNERGETICS.
  1130.  
  1131. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
  1132.  
  1133. % FREE VOICE HELPLINE AND ADDITIONAL INFO: (602) 428-4073
  1134.  
  1135. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1136. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1137.  
  1138. 
  1139.  
  1140.  
  1141.  
  1142.